﻿SELECT ID FROM [User] WHERE [UserName]=N'FG'
SELECT * FROM Problem WHERE NeedRemoteHelp=1
SELECT * FROM Problem ORDER BY Title
OFFSET 1 ROWS -- 略过6行  
FETCH NEXT 1 ROWS ONLY -- 取其后的3行
ALTER TABLE [User]
ALTER COLUMN [Password] NVARCHAR(10) NULL;
SELECT * FROM [Message]
SELECT [Password] FROM [User] WHERE[UserName] = LS
ALTER TABLE Problem DROP CONSTRAINT PK__Problem__3214EC07A6410BF1
ALTER TABLE KeyWordToProblem DROP CONSTRAINT FK_KeyWordToProblem_ProblemId
DROP TABLE Problem 
DROP VIEW V_ProblemKeyword
INSERT Problem(NeedRemoteHelp,Content,UserId ) VALUES(1,N'1',1)
SELECT * FROM Message
UPDATE Message SET HasRead=1 WHERE ID >= 5

SELECT * FROM Problem  ORDER BY Score 
OFFSET 6 ROWS 
FETCH NEXT 3 ROWS ONLY 
GO
CREATE TABLE [dbo].[Problem] (
    [Id]              INT     IDENTITY      NOT NULL,
    [Title]           NVARCHAR (30) NULL,
    [Content]         TEXT          NULL,
    [Reward]          INT           NULL,
    [PublishDateTime] DATE          NULL,
    [NeedRemoteHelp]  BIT           NOT NULL,
    [Author]          NVARCHAR (10) NULL,
    [UserId]          INT           NULL,
    [TPublishTime]    DATETIME      NULL,
    [KeyWord]         INT           NULL,
    [CreateTime]      DATETIME      NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_USER_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([Id]),
    CONSTRAINT [CK_Reward] CHECK ([Reward] < (1000))
);
